package org.easiermock;

import org.junit.Assert;

public class EasierMockBasicBehaviourTest extends AbstractEasierMockTest {
	
	protected <T extends TestInterface> void testStubBehaviour(Class<T> classToStub, Stub stub) {
		TestInterface toStub = EasierMock.createMock(classToStub, stub);
		toStub.method1();
		Assert.assertTrue(stub.wasMethod1Called());
		
		try {
			toStub.method2();
			Assert.fail("Expected exception");
		} catch (UnsupportedOperationException e) {
			// Expected exception
		}
	}
	
}
